package com.uwlaser.rest;

import com.uwlaser.annotation.Log;
import com.uwlaser.service.DataPassStationService;
import com.uwlaser.service.dto.DataPassStationQueryParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @author mx
 * @ClassName:
 * @description:
 * @create 2022-11-09 10:080
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "设备节拍")
@RequestMapping("/api/meter")
public class MeterController {

    private final DataPassStationService dataPassStationService;
    /**
     * 设备节拍
     */
    @PostMapping("/getEquipmentMeter")
    @Log("获取设备节拍")
    @ApiOperation("获取设备节拍")
    public ResponseEntity getEquipmentMeter(@Validated @RequestBody DataPassStationQueryParam dataPassStationQueryParam) throws ParseException {
        return new ResponseEntity<>(dataPassStationService.getEquipmentMeter(dataPassStationQueryParam), HttpStatus.OK);
    }
}
